1. Field of the Invention
The present invention relates to the field of server-side processing and more particularly to server-side translation for custom application support in client-side scripts.
2. Description of the Related Art
Internet server technology and web applications that use asynchronous Javascript (AJAX) and extensible markup language (XML) have become recently popular as developers have enjoyed enhanced user experience as well as significant performance gains. AJAX applications create a bridge by which a web browser can interact with the server to make partial page changes without reloading the entire web page. The asynchronous nature of AJAX allows multiple heterogeneous changes to occur simultaneously while also keeping main content on the page continuously visible to the end user. Unfortunately, web browsers have not yet been instrumented to keep up with new client environments, such as AJAX. As a result, supplemental applications need to overcome browser deficiencies and lack of support for web applications running in new client environments, including AJAX.
AJAX applications can exhibit adverse effects when interacting with applications that have been written exclusively for server-side processing, including legacy applications written before AJAX programming models were developed. As a result, certain applications do not function correctly when used within an AJAX wrapping application, especially when a web application server serves up multiple applications through an AJAX interface.
For instance, if an application uses paradigms that are only realized in a non-AJAX environment, such as a browser “load” event, the application will not work correctly if script/markup is requested asynchronously by the web application server. If the application contains an “onload” handler for the “load” event, but is requested asynchronously through an “XmlHttpRequest”, the result when the Javascript code in the application server loads the response markup into the page will be that the markup will never run its “onload” handler because the “load” event has already been fired by the browser when the page was initially loaded.
While there are current techniques of executing these “onload” handlers manually, the problem occurs when the markup is returned multiple times since the handler may execute correctly the first time, but returns immediately on all subsequent requests since prior execution. For instance, on the “load” event, calling a Javascript function parses the page markup and adds functionality to markup found on the page. The parser would be able to run on the first application that was loaded, but not on any subsequent applications because the parser would detect prior execution.
In order to adequately recover from the above situation, the “onload” handler must be function appropriately within an AJAX environment. While prior attempts include managing script processing on the client, the code required is complicated and tedious to execute without sacrificing performance on the client. While the client-side code parses and rewrites the “onload” handler, utilizing current techniques can decrease performance gains from AJAX,
An additional drawback of rewriting scripts on the client-side includes providing benefit to only the current user in the current browser. Therefore, the server would lack any awareness of the improvement made to the “onload” handler in order to make the handler work within the AJAX environment. As a result, multiple users using multiple browsers would not benefit from the improved function. Disadvantages of rewriting scripts on the client-side can also occur in other environments other than AJAX.
Current techniques on the client-side are limited to improving functions within a client-side environment that cannot inherently support all programming paradigms. Therefore, there is a need to overcome the deficiencies with the prior art and more particularly for a more efficient way to support server-side translation of client-side scripts.